<?php 
ob_start();

include_once("../Adminincludes/config.php");
include_once("../Adminincludes/admin_usertrack.php");


 if(isset($_REQUEST['allbox1']))
	{
		foreach($_REQUEST['allbox1'] as $order_detail_id)
		{
				
$total_credit=mysql_fetch_array(mysql_query("select  adspace_price,siteuserId from tblorderdetail where order_detail_id='".$order_detail_id."' and type='db' and payment_status='N' "));


				$emailid=mysql_fetch_array(mysql_query("select email,username,siteuserId from siteusers where siteuserId='".$total_credit['siteuserId']."' "));
				
				 
				$line.=$emailid['email']."\t";
				$line .= $total_credit['adspace_price']."\t";
				$line .= 'USD';
				$line .= "\n";
	// $update=mysql_query("update tblorderdetail set payment_status='Y' where order_detail_id='".$order_detail_id."' ");
	$to=$emailid['email'];
	$subject ="payment status";
	$message ="Hello ".$emailid['username'].","."\n";
	$message .="we give payment to your paypal account."."\n";
	$message .='Thanks'."\n";
	$message .='Admob Team'."\n";
	
	 $headers = "From: info@admob.com";
	mail($to, $subject, $message, $headers);
		}
	
		
			
		
	}
	 $data .= trim($line)."\n";
	if ($data == "")
		{
		$data = "\n(0) Records Found!\n";						
		}
		else
		{
  		header("Content-type: application/octet-stream");
  		header("Content-Disposition: attachment; filename=mass_pay.xls");
  		header("Pragma: no-cache");
  		header("Expires: 0");
  		print $data;
		}
//header("location:manage_payment.php");